package cn.net.lwj.control;

import cn.net.lwj.services.DemoService;
import javax.annotation.Resource;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/demoControl")
public class DemoControl {
    @Resource
    private DemoService demoService;

    @RequestMapping("test")
    @ResponseBody
    public JSONObject test() {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject = demoService.test();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonObject;
    }

}
